package ink.lvxin.datastructure.ch1;

import ink.lvxin.datastructure.ch1.generic.Person;
import ink.lvxin.datastructure.ch1.generic.Student;

import java.util.Collection;
import java.util.Random;

public class LxTest {
    public static void main(String[] args){
        for (int i = 0; i < 100; i++) {
            Random r = new Random();

            System.out.println(r.nextInt(2));
        }
    }

    
    private static void print(Collection<? extends Person> pc){
        if (pc == null || pc.size() == 0) {
            return;
        }
        Student s = new Student();
        for (Person p : pc) {
            System.out.println(p.getAge());
        }
    }
    private static void print(Person[] ps){
        if (ps == null || ps.length == 0) {
            return;
        }

        ps[1] = new Student();

        for (Person p : ps) {
            if (p == null) {
                continue;
            }
            System.out.println(p.getAge());
        }
    }
}
